/**
 * 
 */
package com.googlecode.bestpaper.output.pdf.book;

import java.awt.Color;

import com.googlecode.bestpaper.output.pdf.PDFHelper;
import com.googlecode.bestpaper.syntax.book.BPSection;
import com.lowagie.text.Font;
import com.lowagie.text.Paragraph;
import com.lowagie.text.Section;

/**
 * @author xalinx at gmail dot com
 * @date Dec 3, 2009
 */
public class PDFSection extends BPSection<Section, Section> {

	/**
	 * @param title
	 */
	public PDFSection(String title) {
		super(title);
	}

	/**
	 * 
	 */
	public PDFSection() {
		
	}

	private Color titleFontColor = new Color(0, 0, 0);

	private int titleFontStyle = Font.BOLD;
	
	private int layer = 0;

	public int getLayer() {
		return layer;
	}

	public void setLayer(int layer) {
		this.layer = layer;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see com.googlecode.bestpaper.output.pdf.PDF#build()
	 */
	@Override
	public Section buildSelf(Section ele, int fontStyle) throws Exception {
		Font titleFont = PDFHelper.getCNFont(getTitleFontSize(),
				titleFontStyle, titleFontColor);
		Paragraph title = new Paragraph(getTitle(), titleFont);
		Section section = ele.addSection(title);
		return section;
	}
}
